﻿<div class="row g-3">
    <div class="col-12 col-sm-6">
        <MultiSelect TValue="string" Items="@Items1" />
    </div>
    <div class="col-12 col-sm-6">
        <MultiSelect TValue="string" Color="Color.Primary" Items="@Items2" />
    </div>
    <div class="col-12 col-sm-6">
        <MultiSelect TValue="string" Color="Color.Success" Items="@Items3" />
    </div>
    <div class="col-12 col-sm-6">
        <MultiSelect TValue="string" Color="Color.Danger" Items="@Items4" />
    </div>
    <div class="col-12 col-sm-6">
        <MultiSelect TValue="string" Color="Color.Warning" Items="@Items5" />
    </div>
    <div class="col-12 col-sm-6">
        <MultiSelect TValue="string" Color="Color.Info" Items="@Items6" />
    </div>
    <div class="col-12 col-sm-6">
        <MultiSelect TValue="string" Color="Color.Secondary" Items="@Items7" />
    </div>
    <div class="col-12 col-sm-6">
        <MultiSelect TValue="string" Color="Color.Dark" Items="@Items8" />
    </div>
</div>

@code {
    [NotNull]
    private List<SelectedItem>? Items1 { get; set; }

    [NotNull]
    private List<SelectedItem>? Items2 { get; set; }

    [NotNull]
    private List<SelectedItem>? Items3 { get; set; }

    [NotNull]
    private List<SelectedItem>? Items4 { get; set; }

    [NotNull]
    private List<SelectedItem>? Items5 { get; set; }

    [NotNull]
    private List<SelectedItem>? Items6 { get; set; }

    [NotNull]
    private List<SelectedItem>? Items7 { get; set; }

    [NotNull]
    private List<SelectedItem>? Items8 { get; set; }

    /// <summary>
    /// OnInitialized
    /// </summary>
    protected override void OnInitialized()
    {
        base.OnInitialized();

        Items1 = GenerateItems();
        Items2 = GenerateItems();
        Items3 = GenerateItems();
        Items4 = GenerateItems();
        Items5 = GenerateItems();
        Items6 = GenerateItems();
        Items7 = GenerateItems();
        Items8 = GenerateItems();

    }

    private static List<SelectedItem> GenerateItems() => new()
    {
        new ("Beijing", "北京"),
        new ("Shanghai", "上海"),
        new ("Guangzhou", "广州"),
        new ("Shenzhen", "深圳"),
        new ("Chengdu", "成都"),
        new ("Wuhan", "武汉"),
        new ("Dalian", "大连"),
        new ("Hangzhou", "杭州"),
        new ("Lianyungang", "连云港")
    };
}
